<template>
  <div>
  <el-container>
    <el-col :span="12">
      <el-menu
        default-active="2"
        class="el-menu-vertical-demo"
        @open="handleOpen"
        background-color="#545c64"
        text-color="#fff"
        active-text-color="#ffd04b"
        router
        @close="handleClose"
      >
        <el-submenu>
          <template slot="title">导航一</template>
          <el-menu-item index="/test1">选项1</el-menu-item>
          <el-menu-item index="/test2">选项2</el-menu-item>
        </el-submenu>
      </el-menu>
    </el-col>
  </el-container>
  </div>
</template>
<script>
export default {
  data() {
    return {};
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    }
  }
};
</script>
<style scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
}
</style>
